Skip to main content

Text-to-Speech API

TTS POST#

https://api.botlhale.xyz/tts
tip

You need to include an Authentication Token in request headers. See the Authentication page of this documentation for information on how to generate authentication token codes.

This endpoint handles single text to speech conversion.

Request ParamsData TypeDescription
TextMsgstringRequiredThis is the text message from the user to the bot.
LanguageCodestringRequiredThis is the language in which the user interacts with the bot.
See the Supported Languages page for a list of supported languages and codes.

Request Example#

import requests
url = "https://api.botlhale.xyz/tts"
payload={  'LanguageCode': 'xh-ZA',  'TextMsg': 'Xa ufuna ukuthenga imoto cofa iqhosha lokuqala.'  }files=[
]headers = {  'Authorization': 'Bearer <IdToken>'}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

Response body#

{    "DateReceived": "01/05/2021 15:38:35",    "LanguageCode": "xh-ZA",    "SpeechResponseURL": "<URL>",    "TextMsg": "Xa ufuna ukuthenga imoto cofa iqhosha lokuqala."}
info

We are here to help! Please email support@botlhale.ai with any questions.